//
//  addressCell.m
//  JinFuThree
//
//  Created by 毛韶谦 on 2018/9/4.
//  Copyright © 2018年 毛韶谦. All rights reserved.
//

#import "addressCell.h"
#import "AddressModel.h"

@interface addressCell ()

@property (nonatomic, strong) UILabel *nameLabel;

@end

@implementation addressCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.right.mas_equalTo(self.contentView);
            make.left.mas_equalTo(self.contentView.mas_left).offset(20);
        }];
        
    }
    return self;
}


- (void)updateInfoCellWithModel:(AddressModel *)model {
    
    if ([model.isSelect isEqualToString:@"1"]) {
        self.nameLabel.textColor = HexColor(0x333333);
    }else {
        self.nameLabel.textColor = HexColor(0x999999);
    }
    self.nameLabel.text = model.label;
}


- (UILabel *)nameLabel {
    
    if (!_nameLabel) {
        _nameLabel = [[UILabel alloc] init];
        _nameLabel.textColor = HexColor(0x999999);
        _nameLabel.font = [UIFont systemFontOfSize:14];
        
        [self.contentView addSubview:_nameLabel];
    }
    return _nameLabel;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
